package com.asia5b.debugapp.transition

import android.view.ViewGroup
import androidx.navigation.findNavController
import com.asia5b.a5mall.middleware.base.SimpleFragment
import com.asia5b.a5mall.middleware.base.SimpleViewModel
import com.asia5b.a5mall.middleware.utils.dddLog
import com.asia5b.debugapp.R
import com.asia5b.debugapp.databinding.FragmentTransition1Binding

/**
 * Created by zhangyuncai on 2020/8/25.
 */
class Transition1Fragment:SimpleFragment<SimpleViewModel,FragmentTransition1Binding>() {
    override val viewModelClazz: Class<SimpleViewModel>
        get() = SimpleViewModel::class.java

    override fun getDataBinding(container: ViewGroup?): FragmentTransition1Binding {
       return FragmentTransition1Binding.inflate(layoutInflater,container,false)
    }

    override fun initView() {
        dddLog("Transition1Fragment.initView")
    }

    override fun initEvent() {
        mDataBinding.btTransition.setOnClickListener {
            it.findNavController().navigate(R.id.action_transition1Fragment_to_transition2Fragment)
        }
    }

    override fun lazyFetchData() {
        dddLog("Transition1Fragment.lazyFetchData")
    }

    override fun onDestroy() {
        super.onDestroy()
        dddLog("Transition1Fragment.onDestroy")
    }
}